package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.NursingPlanDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {

    // 3.1 查询所有护理计划
    List<NursingPlanVo> selectAll();

    // 3.2 新增护理计划（包括护理项目，连NursingProjectPlan表。在查询NursingProject表）
    void insert(NursingPlan nursingPlan);
    // 3.2.1 校验新增的护理计划是否重名
    @Select("select  COUNT(*) from zzyl.nursing_plan where plan_name=#{planName}")
    int CountByPlanName(String planName);

    // 3.3 添加分页查询护理计划
    Page<NursingPlan> listByPage(String name, Integer status);

    //  3.4 根据id查询护理计划
    @Select("select * from zzyl.nursing_plan where id=#{id}")
    NursingPlanVo getNPById(Long id);

    // 3.5 修改护理计划
    void updateNP(NursingPlan nursingPlan);

    //  3.6 删除护理计划
    @Delete("delete from zzyl.nursing_plan where id=#{id}")
    void deleteNPById(Long id);

    // 3.7 启用/禁用护理计划
    void updateStatus(Long id, Integer status);
}
